/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package com.plian.system.service.qg.guarantee;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.plian.system.dto.qg.guarantee.PropertyGuaranteeExecuteDTO;
import com.plian.system.entity.qg.guarantee.PropertyGuaranteeExecute;
import com.plian.system.model.ObjResult;
import com.plian.system.mybatis.base.BaseService;
import com.plian.system.vo.report.ReportReturnVO;

import java.io.File;
import java.math.BigDecimal;

/**
 * 企业担保执行主表 服务类
 *
 * @author jianglei
 * @since 2019-10-24
 */
public interface IPropertyGuaranteeExecuteService extends BaseService<PropertyGuaranteeExecute> {
	/**
	 * 根据JSONObject输出excel
	 * @param jsonObject json对象
	 * @return object
	 */
	File exportExcel(JSONObject jsonObject);

	/**
	 * 校验编码
	 * @param id
	 * @param code
	 * @return
	 */
	Boolean checkIsExisted(Long id, String code);

	/**
	 * 校验上游单据
	 * @param id
	 * @param upstreamCode
	 * @param useAmount
	 * @return
	 */
	String checkUpstreamCode(Long id, String upstreamCode, BigDecimal useAmount);

	/**
	 * 保存或新增
	 * @param propertyGuaranteeExecute
	 * @return
	 */
	Boolean submit(PropertyGuaranteeExecute propertyGuaranteeExecute);


	/**
	 * 保存前的参数校验
	 * @param propertyGuaranteeExecute
	 * @return
	 */
	String checkSubmit(PropertyGuaranteeExecute propertyGuaranteeExecute);

	/**
	 *  企业相关担保金额分析
	 * @param propertyGuaranteeExecuteDTO
	 * @return
	 */
	ReportReturnVO guaranteeAmountAnalysis(PropertyGuaranteeExecuteDTO propertyGuaranteeExecuteDTO);

	/**
	 * 企业相关被担保金额分析
	 * @param propertyGuaranteeExecuteDTO
	 * @return
	 */
	ReportReturnVO guaranteedAmountAnalysis(PropertyGuaranteeExecuteDTO propertyGuaranteeExecuteDTO);

	/**
	 * 校验是否能取消审核和变更
	 * @param id
	 * @return
	 */
	Boolean checkCancel(Long id);

	/**
	 * 执行情况汇总表
	 * @param propertyGuaranteeExecuteDTO
	 * @return
	 */
	ReportReturnVO getExecutes(PropertyGuaranteeExecuteDTO propertyGuaranteeExecuteDTO);

	/**
	 * 修改了list方法
	 * @param queryWrapper
	 * @param page
	 * @return
	 */
	IPage<PropertyGuaranteeExecute> parentList(IPage<PropertyGuaranteeExecute> page, QueryWrapper<PropertyGuaranteeExecute> queryWrapper);


	/**
	 * 担保结束
	 * @param id
	 * @return
	 */
	ObjResult executeFinish(Long id);


	String saveGuaranteeExecuteList(String data);
}
